import request from '@/axios'

interface RoleParams {
  roleName: string
}

export const loginApi = (data: any): Promise<IResponse> => {
  return request.post({ url: '/login/account', data })
}

export const loginOutApi = (): Promise<IResponse> => {
  return request.post({ url: '/loginOut' })
}

export const getAdminRoleApi = (
  params: RoleParams
): Promise<IResponse<AppCustomRouteRecordRaw[]>> => {
  return request.get({ url: '/mock/role/list', params })
}

export const getTestRoleApi = (params: RoleParams): Promise<IResponse<string[]>> => {
  return request.get({ url: '/mock/role/list2', params })
}

//修改密码
export const ResetPasswordApi = (data: any): Promise<IResponse> => {
  return request.get({ url: '/sys/user/reset/pwd', params: data })
}
